function createDataItem(data = {}) {
  const item = {
    id: "",
    title: "",
    icon: "",
    shows: true,
    path: "",
    order: 1,
    pid: "",
    file: "",
    isIframe: "",
    url: "",
    keepAlive: false,
    tabHidden: false,
    tabFix: false,
    httpFile: "",
  };
  for (const itemKey in item) {
    item[itemKey] =
      data[itemKey] || data[itemKey] === false ? data[itemKey] : item[itemKey];
  }
  return item;
}

export default [
  {
    url: "/menus",
    method: "post",
    response: {
      code: 1,
      data: [
        createDataItem({
          id: "100",
          title: "首页",
          path: "/home",
          file: "/view/home/index.vue", // 你的页面路径
          icon: "HomeOutline",
          keepAlive: true,
          tabFix: true,
          order: 100,
        }),
        createDataItem({
          id: "5000",
          title: "动画",
          path: "/animation",
          file: "/view/animation/index.vue", // 你的页面路径
          icon: "LogoPinterest",
        }),
        createDataItem({
          id: "6000",
          title: "内嵌页面",
          icon: "PlanetOutline",
        }),
        createDataItem({
          id: "6002",
          title: "FormGenerator",
          pid: "6000",
          path: "/formDesigner/generator",
          isIframe: true,
          url: "https://www.baidu.com",
        }),
      ],
    },
  },
  {
    url: "/login",
    method: "post",
    response: {
      code: 1,
      data: {
        username: "管理员",
        roles: ["admin", "web"],
        id: "YTSOVNEGA4GPZYT6W5D2",
        accessToken: "SISCA6W7TXZJWKKJFX1772HCIHF2IT",
        expiresTime: "2023-10-01 00:00:00",
      },
    },
  },
  {
    url: "/userInfo",
    method: "post",
    response: {
      code: 1,
      data: {
        username: "管理员",
        roles: ["admin", "web"],
        permission: ["sys:permission:admin", "sys:permission:web"],
      },
    },
  },
];
